package fjut.acm.coding.entity.enums;


public enum OjId {
    /**
     *
     */
    LOCAL(0, "自主出题"),
    POJ(1, "POJ"),
    HDU(0, "HDU");

    private int code;
    private String name;

    OjId(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(int code) {
        for (OjId item : OjId.values()) {
            if (item.getCode() == code) {
                return item.getName();
            }
        }
        return null;
    }
}
